package com.midea.ai.air.ui.more;

import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.TextView;

import com.midea.ai.air.R;
import com.midea.ai.air.common.BaseActivity;
import com.midea.ai.air.ui.more.adapter.MoreSettingAirExpertShowWeekAdapter;
import com.midea.ai.air.view.MyTitleBar;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by hww on 2016/3/29.
 */
public class MoreSettingAirExpertShowWeek extends BaseActivity implements View.OnClickListener {

    private TextView actionbar_left_tv, actionbar_center_tv;
    private ListView listView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_moresettingairexpertshowweek);

        init();
    }


    MyTitleBar myTitleBar;

    private void init() {
        String temp = getIntent().getStringExtra(MoreSettingAirExpertShowTemp.POSITION_SHOW_TEMP);
        myTitleBar = new MyTitleBar(this);
        myTitleBar.setActionBar_center(temp);
        myTitleBar.setActioBar_left(true, R.drawable.register_titler_left, R.string.more_setting_air_expert);
        myTitleBar.setActionBar_right(false, 0);

        actionbar_left_tv = (TextView) findViewById(R.id.actionbar_tv_left);
        actionbar_left_tv.setTextColor(getResources().getColor(R.color.electric_histogram));

        listView = (ListView) findViewById(R.id.more_setting_air_expert_show_week_listView);
        listView.setAdapter(new MoreSettingAirExpertShowWeekAdapter(MoreSettingAirExpertShowWeek.this, getData()));

        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            }
        });
    }

    List<Integer> listData;

    private List<Integer> getData() {
        listData = new ArrayList<Integer>();
        for (int i = 0; i < 3; i++) {
            listData.add(24-i);
        }
        return listData;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.actionbar_left_relativeLayout:

                finish();
                break;
            case R.id.actionbar_tv_right:

                break;
        }
    }

}
